// 提交链接：https://leetcode.cn/problems/length-of-the-longest-alphabetical-continuous-substring/
// lc2414. 最长的字母序连续子字符串的长度 
// 完成日期：2024/9/15
// c++ 字符串

class Solution {
public:
    int longestContinuousSubstring(string s) {
        int l = s.length();
        int count = 1;
        int temp = 1;
        for(int i = 0; i < l; ++i)
        {
            if(s[i] + 1 == s[i+1])
                count++;
            else 
            {
                temp = max(count,temp);
                count = 1;
            }      
        }
        return max(count,temp);
    }
};